#FROM docker.ketches.cn/python:3.10-bullseye
FROM docker.ketches.cn/python:3.10-slim-bullseye
MAINTAINER summer
USER root

COPY requirements.txt /tmp/requirements.txt

RUN echo "" > /etc/apt/sources.list \
 && echo "deb http://mirrors.aliyun.com/debian  stable main contrib non-free" >> /etc/apt/sources.list \
 && echo "deb http://mirrors.aliyun.com/debian  stable-updates main contrib non-free" >> /etc/apt/sources.list \
# && apt-get update && apt-get upgrade -y sqlite3 \
# && apt-get update && apt-get upgrade -y && apt-get install --no-install-recommends -y gcc g++ \
 && pip install --upgrade pip && pip install --no-cache-dir -r /tmp/requirements.txt -i https://mirrors.aliyun.com/pypi/simple \
# && apt-get clean && rm -rf /var/lib/apt/lists/* \
 && mkdir -p /var/data

WORKDIR /code

COPY ./app /code/app

#CMD ["python", "main.py"]
#CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "2"]
CMD ["fastapi", "run", "app/main.py", "--host", "0.0.0.0", "--port", "8000", "--workers", "2"]
EXPOSE 8000
